﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListUsers.aspx.cs" Inherits="RGPWEB.admin.Modubles.ListUsers" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../inc/Style/index.css" rel="stylesheet" type="text/css" />
    <link href="../../inc/Style/childindex.css" rel="stylesheet" type="text/css" />
    <link href="../../inc/Style/GridView.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript">
         function $id(s) {
             return document.getElementById(s);
         }
        //新增数据合法性检测
        function Btn_Search() {
            var ret = true;

            if ($id("txt_name").value == "") {
                alert('请输入用户名');
                ret = false;
            }
           
            return ret;
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Panel ID="TitlePanel" runat="server" CssClass="titlePadding">
        用户管理
    </asp:Panel>
    <asp:Panel ID="ChildPanel" runat="server">
        <div class="rowdiv" style="margin-left: 3px;">
            名称：</div>
        <div class="rowdiv">
            <asp:DropDownList ID="GroupList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="GroupList_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div class="rowdiv" style="margin-left: 10px;">搜索用户名：</div>
        <div class="rowdiv" style="margin-left: 3px;">
            <asp:TextBox ID="txt_name" CssClass="inputbox" runat="server"></asp:TextBox>
        </div>
        <div class="rowdiv" style="margin-left: 5px; line-height: 30px;">
            <asp:Button ID="btn_search" CssClass="smallbtn" runat="server" Text="查找" OnClick="btn_search_Click" /></div>
    </asp:Panel>
    <div id="strinfo" runat="server" class="mbox pbox" visible="false">
    </div>
    <div class="gv">
        <asp:GridView ID="UserList" runat="server" DataKeyNames="UserID" CssClass="Grid"
            OnRowCommand="UserList_RowCommand" OnRowDataBound="UserList_RowDataBound" PageSize="15"
            AutoGenerateColumns="False">
            <FooterStyle CssClass="GridFooter" />
            <RowStyle CssClass="Row" />
            <Columns>
                <asp:BoundField DataField="UserID" HeaderText="编号" ReadOnly="True">
                    <ItemStyle HorizontalAlign="Left" Wrap="false" />
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="用户名">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("UserName") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="用户角色">
                    <ItemTemplate>
                        <asp:Label ID="Lab_RoleName" runat="server" Text=""></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Left" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="用户组">
                    <ItemTemplate>
                        <asp:Label ID="Lab_GroupName" runat="server" Text='<%# Eval("UG_Name") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="状态">
                    <ItemTemplate>
                        <asp:Label ID="Lab_state" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
                <asp:BoundField HeaderText="创建时间" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}">
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:BoundField HeaderText="最后一次登录时间" DataField="LastLoginTime" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}">
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="授权" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="btn_grant" runat="server" CausesValidation="False" CommandName="Grant"
                            Text="授权" CommandArgument='<%# Eval("UserID").ToString()+","+Eval("UserName").ToString()%>'></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="查看" ShowHeader="False">
                    <ItemTemplate>
                        <asp:HyperLink ID="link_view" runat="server" NavigateUrl='<%# Eval("UserID", "EditUserPage.aspx?uid={0}") %>'
                            Text="查看详情"></asp:HyperLink>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="删除" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="btn_del" runat="server" CausesValidation="False" CommandName="Del"
                            Text="删除" CommandArgument='<%# Eval("UserID")%>'></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Wrap="False" />
                    <ItemStyle HorizontalAlign="Center" Wrap="False" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="HeadingCell" />
            <AlternatingRowStyle BorderStyle="None" CssClass="AlternatingRow" />
        </asp:GridView>
        <div id="GridViewMsg" style="padding: 5px;" runat="server">
        </div>
    </div>
    </form>
</body>
</html>
